package com.qinyunkj.searchchatserver.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qinyunkj.searchchatserver.mapper.CrawlerLogMapper;
import com.qinyunkj.searchchatserver.model.entity.CrawlerLog;
import com.qinyunkj.searchchatserver.service.CrawlerLogService;
import org.springframework.stereotype.Service;

@Service
public class CrawlerLogServiceImpl extends ServiceImpl<CrawlerLogMapper, CrawlerLog> implements CrawlerLogService {

    @Override
    public Page<CrawlerLog> pageLog(Integer pageNum, Integer pageSize) {
        Page<CrawlerLog> page = new Page<>(pageNum, pageSize);
        lambdaQuery().orderByDesc(CrawlerLog::getCreateTime).page(page);
        return page;
    }

    @Override
    public void recordLog(CrawlerLog log) {
        save(log);
    }
} 